#ifndef CONSTRAINTLIST_H
#define CONSTRAINTLIST_H

#include <vector>
#include <string>

using namespace std;

// forward declarations:
class TableConstraint;

/*
    Class: ConstraintList
    Storage a list of constraints.
*/
class TableConstraintList
{
    /* Section: public */
    public:
        /*
            Destructor: Default destructor.
            Destroy the object.
        */
        virtual ~TableConstraintList();

        /*
            Constructor: Copy constructor.
            Initializes the object as a copy of other TableConstraintList object.

            Parameters:
                other - TableConstraintList object to copy from.
        */
        TableConstraintList(const TableConstraintList& other);

        /*
            Contructor: Parametrized constructor.
            Initializes the object with the given parameters.

            Parameters:
                columns - vector of TableConstraints of the TableConstraintList.
        */
        TableConstraintList(vector<TableConstraint *> * columns = NULL);

        /*
            Method: SetTableConstraints
            Sets a vector of TableConstraints to the object. Destroy the previos set of columns if any.

            Parameters:
                columns - vector of TableConstraints to set.

            See also:
                TableConstraint
        */
        void setTableConstraints(vector<TableConstraint *> * columns);

        /*
            Method: GetTableConstraints
            Returns:
                A const pointer to the vector of columns of the object

            See also:
                TableConstraint
        */
        vector<TableConstraint *> * getTableConstraints() const;

        /*
            Method: AddTableConstraint
            Adds a new column to the ColumList. (Adds a clone)

            Parameters:
                column - TableConstraint to add.

            See also:
                TableConstraint
        */
        void addTableConstraint(TableConstraint * constraint);

        /*
            Method: size
            Returns:
                Number of columns of the TableConstraintList.
        */
        virtual int size();

        /*
            Method: ToString
            Returns:
                A string representation of the list of constraints.
        */
        string toString();

        /*
            Method: clone
            Returns:
                A clone of this object.
        */
        TableConstraintList * clone();

    /* Section: protected */
    private:
        /*
            Variable: columns
            Type: vector<TableConstraint *> *
            List of columns.

            See also:
                TableConstraint
        */
        vector<TableConstraint *> * constraints;
};

#endif // CONSTRAINTLIST_H
